/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package csci6450.chickenFriedFS.nuggetClient.threads.functions;

import csci6450.chickenFriedFS.nuggetClient.threads.MetaServerCommunicator;
import csci6450.chickenFriedFS.nuggetCore.NuggetConstants;
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Date;

/**
 *
 * @author jacobschoen
 */
public class TimestampMetaServer extends MetaServerCommunicator{

    public Date execute() throws UnknownHostException, IOException, ClassNotFoundException{
        this.initializeConnection();
        this.getOutputStream().writeObject(NuggetConstants.TIMESTAMP);
        this.getOutputStream().flush();
        Date timestamp = (Date)this.getInputStream().readObject();
        this.closeConnection();
        //boolean stopped  = false;
        return timestamp;
    }
}
